page.tsx 650 B

12345678910111213141516171819202122232425262728
  1. import { fetchUserFollowing } from '@/lib/api/account/profile';
  2. import FollowList from '../_component/FollowList';
  3. type Props = {
  4. params: Promise<{ sid: string }>;
  5. };
  6. const PER_PAGE = 20;
  7. export default async function UserFollowingPage({ params }: Props) {
  8. const { sid } = await params;
  9. const res = await fetchUserFollowing(sid, 1, PER_PAGE);
  10. const data = res.data ?? { total: 0, list: [] };
  11. return (
  12. <>
  13. <h2 className="user-profile__subtab-title">팔로우</h2>
  14. <FollowList
  15. mode="following"
  16. memberSID={sid}
  17. initialList={data.list}
  18. initialTotal={data.total}
  19. initialPage={1}
  20. perPage={PER_PAGE}
  21. />
  22. </>
  23. );
  24. }